/*package com.robusta.cityuate.adapters;

import java.util.ArrayList;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseExpandableListAdapter;
import android.widget.TextView;

import com.robusta.cityuate.R;
import com.robusta.cityuate.objects.Reservation;
import com.robusta.cityuate.objects.TimeSlot;

public class TimeSlotsExpandableAdapter extends BaseExpandableListAdapter {

	private Context mContext;
	ArrayList<TimeSlot> timeSlots;
	private LayoutInflater mLayoutInflater;

	public TimeSlotsExpandableAdapter(Context context) {
		super();
		this.mContext = context;
		timeSlots = new ArrayList<TimeSlot>();
		mLayoutInflater = (LayoutInflater) mContext
				.getSystemService(Context.LAYOUT_INFLATER_SERVICE);

	}

	@Override
	public Object getChild(int groupPosition, int childPosition) {

		return timeSlots.get(groupPosition).getReservations()
				.get(childPosition);
	}

	@Override
	public long getChildId(int groupPosition, int childPosition) {
		return timeSlots.get(groupPosition).getReservations()
				.get(childPosition).getId();
	}

	@Override
	public View getChildView(int groupPosition, int childPosition,
			boolean isLastChild, View convertView, ViewGroup parent) {
		Reservation res = (Reservation) getChild(groupPosition, childPosition);
		View itemView;
		if (convertView == null)
			itemView = mLayoutInflater.inflate(R.layout.reservation_list_item,
					parent, false);
		else
			itemView = convertView;

		//TextView userF = (TextView) itemView.findViewById(R.id.user_name);
		TextView fromF = (TextView) itemView.findViewById(R.id.available_at);
		TextView tillF = (TextView) itemView.findViewById(R.id.available_till);

	//	userF.setText(res.getReserver().getFirst_name() + " "
		//		+ res.getReserver().getLast_name());
		fromF.setText(res.getCheckInTime().toString());
		tillF.setText(res.getCheckoutTime().toString());

		return itemView;
	}

	@Override
	public int getChildrenCount(int position) {

		return timeSlots.get(position).getReservations().size();
	}

	@Override
	public Object getGroup(int position) {
		return timeSlots.get(position);
	}

	@Override
	public int getGroupCount() {
		return timeSlots.size();
	}

	@Override
	public long getGroupId(int position) {
		return timeSlots.get(position).getId();
	}

	@Override
	public View getGroupView(int position, boolean arg1, View convertView,
			ViewGroup parent) {
		TimeSlot timeSlot = (TimeSlot) getGroup(position);
		View itemView;
		if (convertView == null)
			itemView = mLayoutInflater.inflate(R.layout.time_slot_item, parent,
					false);
		else
			itemView = convertView;

		TextView fromF = (TextView) itemView.findViewById(R.id.available_at);
		TextView tillF = (TextView) itemView.findViewById(R.id.available_till);

		fromF.setText(timeSlot.getStartTime().toString());
		tillF.setText(timeSlot.getEndTime().toString());

		return itemView;
	}

	@Override
	public boolean hasStableIds() {
		return true;
	}

	@Override
	public boolean isChildSelectable(int groupPosition, int childPosition) {
		return true;
	}
	
	@SuppressWarnings("unchecked")
	public void setGroupsList(ArrayList<TimeSlot> timeSlots){
		this.timeSlots=(ArrayList<TimeSlot>) timeSlots.clone();
		notifyDataSetChanged();
	}

}
*/